package com.dc.snow;

/**
 * @author: KEYD
 * @Date: 2020/1/11 20:35
 * @Desc: 封装雪花算法成单例
 */
public class SnowflakeIdUtils {

    private static SnowflakeIdWorker idWorker;

    static {
        // 使用静态代码块初始化 SnowflakeIdWorker
        idWorker = new SnowflakeIdWorker(1, 1);
    }

    public static String nextId() {
        return idWorker.nextId() + "";
    }


}
